<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/21
 * Time: 11:07
 */

namespace app\admin\model;


use think\Model;

class WaterMultiple extends Model
{
    // 表名
    protected $name = 'water_multiple';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    public function user()
    {
        return $this->hasOne('app\admin\model\User','id','user_id')->setEagerlyType(0);
    }
    public function record()
    {
        return $this->hasOne('app\admin\model\wallet\Record','record_sn','record_sn')
            ->field('id,record_sn,type,createtime');
    }
}